﻿namespace Zinnia.Caching
{
    /// <summary>
    /// 信号器
    /// </summary>
    public interface ISignals : IVolatileProvider
    {
        /// <summary>
        /// 触发令牌
        /// </summary>
        /// <typeparam name="T">信号对象</typeparam>
        /// <param name="singal">触发令牌的信号</param>
        void Trigger<T>(T singal);
        /// <summary>
        /// 获取令牌，并存入字典
        /// </summary>
        /// <typeparam name="T">信号对象</typeparam>
        /// <param name="singal">触发令牌的信号</param>
        /// <returns></returns>
        IVolatileToken When<T>(T singal);
    }
}
